public class Book {
    public String isbn;
    public String bookName;
    public String author;
    public double price;
    public Book(String isbn,String bookName,String author,double price){
        this.isbn=isbn;
        this.bookName=bookName;
        this.author=author;
        this.price=price;
    }
    public static void ASearch(Book[] arrays,String author){
        for (int i = 0; i < arrays.length; i++) {
            if((arrays[i].author).equals(author)){
                System.out.println(arrays[i].bookName);
            }
        }
    }
    public static void PSearch(Book[] arrays,double price){
        for (int i = 0; i < arrays.length; i++) {
            if(price>arrays[i].price-10&&price<arrays[i].price+10){
                System.out.println(arrays[i].bookName);
            }
        }
    }

    public static void main(String[] args) {
        Book book1=new Book("001","语文","小明",66);
        Book book2=new Book("002","数学","小红",88);
        Book book3=new Book("003","英语","小花",68);
        Book[] array={book1,book2,book3};
        ASearch(array,"小明");
        PSearch(array,60);
    }
}
